<template>
  <div class="item">
    <img :src="obj.picture" alt="" />
    <p class="name">{{ obj.name }}</p>
    <p class="price">{{ obj.price }}</p>
  </div>
</template>

<script>
export default {
  props: {
    obj: {
      type: Object,
      required: true,
    },
  },
};
</script>

<style>
.item {
  width: 240px;
  margin-left: 10px;
  padding: 20px 30px;
  transition: all 0.5s;
  margin-bottom: 20px;
}

.item:nth-child(4n) {
  margin-left: 0;
}

.item:hover {
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  transform: translate3d(0, -4px, 0);
  cursor: pointer;
}

.item img {
  width: 100%;
}

.item .name {
  font-size: 18px;
  margin-bottom: 10px;
  color: #666;
}

.item .price {
  font-size: 22px;
  color: firebrick;
}

.item .price::before {
  content: "¥";
  font-size: 14px;
}
</style>